<section id="widget-grid" class="">
	<div class="alert alert-danger fade in" ng-show="showErrorMessages()">
		<button class="close" ng-click="clearErrorMessages()">×</button>
		<i class="fa-fw fa fa-times"></i> <strong>出错了!</strong>
		{{errorMessage}}.
	</div>


	<div class="row">
		<article class="col-sm-12 col-md-12">
			<div class="jarviswidget jarviswidget-color-blueDark" id="wid-id-4">
				<header>
					<span class="widget-icon"> <i class="fa fa-edit"></i>
					</span>
					<h2>用户编辑</h2>
				</header>

				<div>
					<div class="widget-body no-padding">
						<form name="userCreateForm" id="smart-form-user-create"
							class="smart-form two-columns-form" ng-submit="save(user)"
							novalidate>
							<header> 用户编辑 </header>

							<fieldset>
								<div class="row">
									<section class="col col-6">
										<label class="label col col-2">用户名 ：</label>
										<div class="col col-10">
											<label ng-class="getValidationClass(userCreateForm.username)"
												class="input "> <i class="icon-append fa fa-user"></i>
												<input type="text" name="username" ng-model="user.username"
												placeholder="请填写用户登录名，由数字字母组成" ng-minlength="6"
												ng-maxlength="20"
												ng-pattern="/^[a-zA-Z]{1}[0-9a-zA-Z_]{0,}$/" required
												user-unique="username">
											</label>
											<div class="error">
												<em class="invalid"
													ng-show="isValidatedOf(userCreateForm.username, 'required')">
													请输入用户名 </em> <em class="invalid"
													ng-show="isValidatedOf(userCreateForm.username, ['minlength', 'maxlength'])">
													用户长度要在6到20位之间！ </em> <em class="invalid"
													ng-show="isValidatedOf(userCreateForm.username, 'user-unique')">
													该用户名已经存在 </em> <em class="invalid"
													ng-show="isValidatedOf(userCreateForm.username, 'pattern')">
													用户名需字母开头，只支持字母、数字和_ </em>
											</div>
										</div>
									</section>
								</div>
								<div class="row">
									<section class="col col-6">
										<label class="label col col-2">姓名 ：</label>

										<div class="col col-10">
											<label class="input"
												ng-class="getValidationClass(userCreateForm.fullname)">
												<i class="icon-append fa fa-male"></i> <input type="text"
												name="fullname" ng-model="user.fullname"
												placeholder="请填写用户名称" required>
											</label>
											<div class="error">
												<em class="invalid"
													ng-show="isValidatedOf(userCreateForm.fullname, 'required')">
													姓名不能为空！ </em>
											</div>
										</div>
									</section>

									<section class="col col-6">
										<label class="label col col-2">邮箱 ：</label>

										<div class="col col-10">
											<label class="input"
												ng-class="getValidationClass(userCreateForm.email)">
												<i class="icon-append fa fa-envelope-o"></i> <input
												type="email" name="email" ng-model="user.email"
												placeholder="请填写有效的邮箱地址" required user-unique="email">
											</label>
											<div class="error">
												<em class="invalid"
													ng-show="isValidatedOf(userCreateForm.email, 'required')">
													邮箱不能为空！ </em> <em class="invalid"
													ng-show="isValidatedOf(userCreateForm.email, 'email')">
													请填写有效的邮箱地址! </em> <em class="invalid"
													ng-show="isValidatedOf(userCreateForm.email, 'user-unique')">
													该邮箱已经注册 </em>
											</div>
										</div>
									</section>
								</div>

								<div class="row">
									<section class="col col-6">
										<label class="label col col-2">密码 ：</label>
										<div class="col col-10">
											<label class="input"
												ng-class="getValidationClass(userCreateForm.password)">
												<i class="icon-append fa fa-lock"></i> <input
												type="password" name="password" ng-model="user.password"
												placeholder="用户登录密码，由字母数字组成" id="password" required
												password-validate>
											</label>
											<div class="error">
												<em class="invalid"
													ng-show="isValidatedOf(userCreateForm.password, 'pwd')">
													密码由6到12个字符组成，包含至少一个数字和字母！ </em>
											</div>
										</div>
									</section>

									<section class="col col-6">
										<label class="label col col-2">确认密码 ：</label>
										<div class="col col-10">
											<label class="input"
												ng-class="getValidationClass(userCreateForm.comfirmPassword)">
												<i class="icon-append fa fa-lock"></i> <input
												type="password" name="comfirmPassword" placeholder="请再次输入密码"
												required password-match="user.password"
												ng-model="comfirmPassword">
											</label>
											<div class="error">
												<em class="invalid"
													ng-show="isValidatedOf(userCreateForm.comfirmPassword, 'matched')">
													确认密码不匹配！ </em>
											</div>
										</div>
									</section>
								</div>
								<div class="row">
									<section class="col col-6">
										<label class="label col col-2">状态 ：</label>
										<div class="col col-10 inline-group">
											<label class="radio"> <input type="radio"
												name="enablement" ng-model="user.enablement" ng-value="true">
												<i></i>激活
											</label> <label class="radio"> <input type="radio"
												name="enablement" ng-model="user.enablement"
												ng-value="false"> <i></i>未激活
											</label>
										</div>
									</section>
									<section class="col col-6">
										<label class="label col col-2">管理员 ：</label>
										<div class="col col-10">
											<div class="inline-group">
												<label class="checkbox"> <input type="checkbox"
													ng-model="user.role" name="role" ng-true-value="ADMIN"
													ng-false-value="BASIC"> <i></i>
												</label>
											</div>
										</div>
									</section>
								</div>
							</fieldset>

							<footer>
								<button onclick="window.history.back();" class="btn btn-default"
									type="button">Back</button>
								<button type="submit" ng-disabled="userCreateForm.$invalid"
									class="btn btn-primary">保存</button>
							</footer>
						</form>
					</div>
				</div>
			</div>
		</article>
	</div>
</section>